package com.itheima.包装类;

/**
 * @Author 王加鑫
 * @Date 2021/5/10 15:11
 * @Version 1.0
 */
public class IntegerTest2 {

    public static void main(String[] args) {
        String s1 = "100";
        //String转int
        int a = Integer.parseInt(s1);
        System.out.println(a);
        //int转String
        String s2 = a + "";
        System.out.println(s2);


        String s3 = "100";
        //String转int
        int b = Integer.valueOf(s3);
        System.out.println(b);
        //int转String
        String s4 = String.valueOf(b);
        System.out.println(s4);

        /*
        -128 - 127 Integer 值相同地址也相同
         */
        Integer i1 = 150;
        Integer i2 = 150;
        System.out.println(i1 == i2);

        Integer i3 = 100;
        Integer i4 = 100;
        System.out.println(i3 == i4);
    }
}
